﻿{layout:default} {class:Shop.Supplier.Config.Profile}
<lbhead>
    <title><%=Tag("编辑资料")%>-<%=site.title%></title>
</lbhead>
<lbfile>
    <script type="text/javascript" src="<%=site.AdminJsPath %>/ajaxfileupload.js"></script>
    <style type="text/css">.bottom{display:none;height:0;overflow:hidden}</style>
</lbfile>
<lbpath>
    <div class="tools">
    <ul>
    <%if (PageReturnMsg == ""){%>
    <li class="submit"><a href="javascript:void(0);" onclick="SaveObj(0);"><b></b><span><%=Tag("保存")%></span></a></li>
    <%}%>
    <li class="name"><span id="navIgation"><%=Tag("当前位置")%>：<a href="<%=site.AdminPath %>/Ajax/ajax_supplier.aspx?__Action=MenuJump&pid=0"><%=Tag("管理首页")%></a> > <%=Tag("编辑资料")%></span></li>
    </ul>
    </div>
</lbpath>
<lbbody>
<div class="searchbox clear">
    <div class="searchbox-l">
    <ul class="tabmenus">
        <li class="current"><a href="profile.aspx"><span><%=Tag("编辑资料")%></span></a></li>
        <li><a href="description.aspx"><span><%=Tag("店铺信息")%></span></a></li>
    </ul>
    </div>
    <div class="searchbox-r">
    </div>
</div>
<table class="table">
    <tr>
        <th>
            Logo：
        </th>
        <td>
            <div id="image_Logo">
                <%if (model.Logo != "")
                    {%>
                <img height="60" src="<%=Image(model.Logo)%>" />
                <%} %>
            </div>
            <input type="hidden" shop="true" id="Logo" name="Logo" class="input" style="width: 200px;" value="<%=model.Logo%>" readonly /> 
            <input id="file_Logo" name="file_Logo" type="file" class="input" onchange="uploadImage('Logo')" />
<!--            <input type="button" value="上传" onclick="uploadImage('Logo')" />-->
            <em>width:200px | height:200px</em>
        </td>
    </tr>
    <tr>
        <th>
            <%=Tag("公司名称")%>：
        </th>
        <td>
            <input type="text" shop="true" min="notnull" id="Company" name="Company" size="50" class="input" value="<%=model.Company %>" />
        </td>
    </tr>
    <tr>
        <th>
            <%=Tag("店铺简称")%>：
        </th>
        <td>
            <%=model.SubName %>
        </td>
    </tr>
    <tr>
        <th>
            <%=Tag("联系人")%>：
        </th>
        <td>
            <input type="text" shop="true" min="notnull" id="RealName" name="RealName" class="input" value="<%=model.RealName %>" style="width:200px" />
        </td>
    </tr>
    
    <tr>
        <th>
            <%=Tag("手机号码")%>：
        </th>
        <td>
            <input type="text" shop="true" min="notnull" id="MobilePhone" name="MobilePhone" class="input" value="<%=model.MobilePhone %>" style="width:200px" />
        </td>
    </tr>
    <tr>
        <th>
            <%=Tag("电话号码")%>：
        </th>
        <td>
            <input type="text" shop="true" min="notnull" id="Phone" name="Phone" class="input" value="<%=model.Phone %>" style="width:200px" />
        </td>
    </tr>
    <tr>
        <th>
            <%=Tag("QQ号码")%>：
        </th>
        <td>
            <input type="text" shop="true" min="notnull" id="QQ" name="QQ" class="input" value="<%=model.QQ %>" style="width:200px" />
        </td>
    </tr>
    <tr>
        <th>
            <%=Tag("Email地址")%>：
        </th>
        <td>
            <input type="text" shop="true" min="notnull" id="Email" name="Email" class="input" value="<%=model.Email %>" style="width:200px" />
        </td>
    </tr>
    <tr>
        <th>
            <%=Tag("地区")%>：
        </th>
        <td id="Area_id_div">
        </td>
    </tr>
    <tr>
        <th>
            <%=Tag("联系地址")%>：
        </th>
        <td>
            <input type="text" shop="true" min="notnull" id="Address" name="Address" size="50" class="input" value="<%=model.Address %>" />
        </td>
    </tr>
    <tr>
        <th>
            <%=Tag("邮政编码")%>：
        </th>
        <td>
            <input type="text" shop="true" min="notnull" id="Postalcode" name="Postalcode" class="input" value="<%=model.Postalcode %>" style="width:200px" />
        </td>
    </tr>
    <tr>
        <th>
            <%=Tag("状态")%>：
        </th>
        <td>
            <%=Shop.Bussiness.EX_Type.TypeName(model.Type_id_SupplierStatus,CurrentLanguage.Code)%>
        </td>
    </tr>
    <tr>
        <th>
            <%=Tag("金额")%>：
        </th>
        <td>
            <%=FormatMoney(model.Money) %>
        </td>
    </tr>
    <tr>
        <th>
            <%=Tag("保证金")%>：
        </th>
        <td>
            <%=FormatMoney(model.Money_Margin) %>
            &nbsp;&nbsp;&nbsp;
            <%=Tag("状态")%>：<%=(model.Money_Margin_pay>=model.Money_Margin?Tag("已缴"):Tag("未缴"))%>
            <%if(model.Money_Margin_pay<model.Money_Margin){ %>
            <a href="javascript:void(0);" onclick="PayWindow('suppliermargin',0,'<%=Tag("缴纳保证金")%>',<%=model.Money_Margin-model.Money_Margin_pay%>);" ><%=Tag("缴费") %></a>
            <%} %>
        </td>
    </tr>
    <tr>
        <th>
            <%=Tag("服务费")%>：
        </th>
        <td>
            <%=FormatMoney(model.Money_Service) %>
            &nbsp;&nbsp;&nbsp;
            <a href="javascript:void(0);" onclick="PayWindow('supplierservice',0,'<%=Tag("服务费续费")%>',<%=model.Money_Service%>);" ><%=Tag("续费") %></a>
        </td>
    </tr>
    <tr>
        <th>
            <%=Tag("结账天数")%>：
        </th>
        <td>
            <%=model.BillingDays %>
        </td>
    </tr>
    <%if (model.ProductTop > 0)
      { %>
    <tr>
        <th>
            <%=Tag("商品上限")%>：
        </th>
        <td>
            <%=model.ProductTop%>
        </td>
    </tr>
    <%} %>
    <tr>
        <th>
            <%=Tag("服务期限")%>：
        </th>
        <td>
            <%=FormatDate(model.Time_Begin) %> - <%=FormatDate(model.Time_End)%>
        </td>
    </tr>
</table>
<script type="text/javascript">
    GetAreaList(<%=SYS.TopAreaid %>, <%=model.Area_id %>); //加载地区下拉框
    function SaveObj() {
        var postData = GetFormJsonData("shop");
        if (!CheckForm("shop", "span"))
            return false;
        var Area_id = $("#Area_id").val();
        if (Area_id == 0) {
            CheckNO('Area_id','','span');
            return false;
        }
        var url = "<%=site.AdminPath %>/ajax/ajax_config.aspx?__Action=Profile_Edit&Area_id="+ Area_id;
        RequestAjax(url,postData,function(){
        <%if (model.Type_id_SupplierStatus==9010){ %>MsgBox(1, "<%=Tag("请进行身份验证")%>", "verified.aspx")}
        <%}else{ %>
        MsgBox(1, "<%=Tag("操作成功")%>", "")}
        <%} %>
        );
    }
    function uploadImage(id) {
        $.ajaxFileUpload
        (
	        {
	            url: WebPath + '/ajax/imageuploadone.aspx?path=supplierlogo',
	            secureuri: false,
	            fileElementId: 'file_' + id,
	            dataType: 'json',
	            success: function (data, status) {
	                if (data.msg != 'OK') {
	                        MsgBox(2, data.msg, "");
	                    }
	                    else {
	                        var imageUrl = data.ImageUrl;
	                        if (imageUrl.length > 0) {
	                            $("#image_" + id + "").html('<img height="60" src=' + WebPath + imageUrl + '>');
	                            $("#" + id + "").val(imageUrl);
	                        }
	                    }
	            }
	        }
        )
    }
</script>
</lbbody>
<lbbottom>
    <div class="bottom" id="body_bottom">
    </div>
</lbbottom>